﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core.common;
using ibba.agil.core;

namespace ibba.agil.data.data
{
    public class tbagi003GrupEvenKey : IDataKey
    {
        public int codGrupEven { get; set; }
        public string indAtivInat { get; set; }
    }

    public class tbagi003GrupEven_COL : CollectionData<tbagi003GrupEvenKey, tbagi003GrupEven_ENT>
    {
        private manager.tbagi003GrupEven_COM _manager;
        private Criteria<CriteriaInfo, object> _pesquisa;

        public tbagi003GrupEven_COL()
        {
            _manager = new manager.tbagi003GrupEven_COM();
        }

        protected override Criteria<CriteriaInfo, object> CriteriaFind()
        {
            return _pesquisa;
        }

        public override List<tbagi003GrupEven_ENT> Find(tbagi003GrupEvenKey key)
        {
             #region Implementacao do Criterio de Pesquisa

            _pesquisa = new Criteria<CriteriaInfo, object>(new tbagi003GrupEven_ENT());
            //_pesquisa.Add(new CriteriaInfo()
            //{
            //    EntityData = new tbagi003GrupEven_ENT(),
            //    LikePattern = LikePattern.Both,
            //    LogicalType = LogicalOperator.AND,
            //    NameProperty = "codGrupEven",
            //    SearchType = LogicalComparator.EQUAL
            //}, key.codGrupEven);

            #endregion

            return _manager.Where(CriteriaFind);
        }
    }
}
